<template>
  <div>Order</div>
</template>

<script>
import store from "@/store";
import { mapState } from "vuex";
export default {
  name: "Order",
  data() {
    return {};
  },
  //组件内的路由守卫
  beforeRouteEnter(to, from, next) {
    let token = localStorage.getItem("x-auth-token");
    if (token) {
      next();
    } else {
      store.dispatch("ToastStatus/asyncChangeIsShowToast", {
        msg: "请先登录！",
        type: "warning",
      });
    }
  },
  computed: {
    ...mapState({
      userInfo: (state) => state.userInfo.userInfo,
    }),
  },
};
</script>

<style lang="less" scoped>
div {
  width: 222px;
  height: 222px;
}
</style>